﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for ChiTietPhieuNhap
/// </summary>
public class EChiTietPhieuNhap
{
    private int maPN;
    private string maSP;
    private int soLuong;
    private string gia;
    public EChiTietPhieuNhap()
    { }
    public EChiTietPhieuNhap(int maPN, string maSP, int soLuong, string gia)
    {
        this.maPN = maPN;
        this.maSP = maSP;
        this.soLuong = soLuong;
        this.gia = gia;
    }
    public int MaPN
    {
        get { return this.maPN; }
        set
        {
            if (value == null)
                throw new Exception("maPN not allow nullvalue.");
            this.maPN = value;
        }
    }
    public string MaSP
    {
        get { return this.maSP; }
        set
        {
            if (value == null)
                throw new Exception("maSP not allow nullvalue.");
            this.maSP = value;
        }
    }
    public int SoLuong
    {
        get { return this.soLuong; }
        set { this.soLuong = value; }
    }
    public string Gia
    {
        get { return this.gia; }
        set { this.gia = value; }
    }
    public override string ToString()
    {
        return this.maPN + "; " + this.maSP + "; " + this.soLuong + "; " + this.gia + "; ";
    }
    public override bool Equals(Object obj)
    {
        EChiTietPhieuNhap me = (EChiTietPhieuNhap)obj;
        bool ret = this.MaPN.Equals(me.MaPN) && this.MaSP.Equals(me.MaSP);
        return ret;
    }
    public override int GetHashCode()
    {
        return this.MaPN.GetHashCode() + this.MaSP.GetHashCode();
    }

}